home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d19
/
yt28beta.arc
/
LOCAL.BAS
< prev
next >
Wrap
BASIC Source File
|
1990-10-01
|
4KB
|
149 lines
Rem //* Local logon program for Yankee Trader v1.0 \\*
rem //* Copyright 1990 by Alan Davenport \\*
Rem //* For QuickBasic 3.0 \\*
color 14
cls
dim users$(500)
users$ = command$ 'take user number from command line input
print
print "Yankee Trader Local Logon Program v1.0
print "Copyright 1990 by Alan Davenport
print
open "local.dat" as 1 len = 40
field #1,40 as local$
if lof(1) <> 0 then
for r = 1 to lof(1) / 40
get 1,r
users$(r) = local$
next r
end if
display.list:
if users$(1) <> "" then 'display list if no command line input
if users$ = "" then
for r = 1 to lof(1) / 40
if users$(r) = "" then exit for
print str$(r);"]",users$(r)
if (r mod 15) = 0 then
print "[Pause]";
while inkey$= ""
wend
cls
print
end if
next r
print
print "Enter user number, press [ENTER] for NEW or LIST. -=> ";
line input a$
if a$ = "list" or a$ = "LIST" then goto display.list
num = val(a$)
else
num = val(users$) 'take user number from command line input
users$ = ""
end if
if users$(num) = "" and num <> 0 then goto display.list
player$ = users$(num)
end if
if player$ = "" then
enter.new.player:
print
print
print "Enter your name please or press [ENTER] to quit. -=> ";
line input player$
if player$ = "" then
close
print
print "Aborted!"
end
end if
print
print chr$(34);player$;chr$(34);" ";
print "is this ok? (Y/n) ";
line input a$
if a$ = "n" or a$ = "N" then goto enter.new.player
lset local$ = player$
put 1,lof(1) / 40 + 1
end if
close
Rem //* Massage player$ \\*
'strip leading spaces
while left$(player$,1) = " "
player$ = right$(player$,len(player$) - 1)
wend
'strip trailing spaces
while right$(player$,1) = " "
player$ = left$(player$,len(player$) - 1)
wend
'strip imbedded double spaces
while instr(player$," ")
x = instr(player$," ")
player$ = left$(player$,x -1) + right$(player$,len(player$) - x)
wend
'turn to all upper case
for r = 1 to len(player$)
a$ = mid$(player$,r,1)
if a$ => "a" and a$ <= "z" then mid$(player$,r,1) = chr$(asc(a$) and 223)
next r
'split off first and last names
first$ = left$(player$,instr(player$ + " "," ") - 1)
if len(first$) <> len(player$) then 'needed to deal with single name names
last$ = right$(player$,len(player$) - len(first$) - 1)
end if
'//* OK, create a DORINFO1.DEF and run Yankee Trader \\*
print
print "Loading...
open "DORINFO1.DEF" for output as 1
Print #1,"Yankee Trader Local Logon Program" 'bbs name
print #1,"Alan" 'sysop first name
print #1,"Davenport" 'sysop last name
print #1,"COM0 'com port (0 = local)
print #1,"0 BAUD,N,8,1 'baud rate (0 = local)
print #1,0 'multi tasker type
print #1,first$ 'user first name
print #1,last$ 'user last name
Print #1,"Anytown, USA" 'user city/state
print #1,1 'graphics yes/no
print #1,100 'user security level
print #1,45 'user time limit
print #1,0 'fossil yes/no
close
shell "YT.EXE DORINFO1.DEF"
locate 25,1 'cursor to screen bottom
end